import { defineStore } from 'pinia';

export const useSearchStore =
    defineStore('searchResult', {
    // 定义状态
    state: () => ({
         searchResult: "", // 自动转换为响应式数据
    }),
    // 定义操作
    actions: {
       updateResult(result: string) {
            this.searchResult = result;
           console.log("searchQuery.value in store: ", this.searchResult )
       }
    },
    // 定义计算属性
    getters: {
        getSearchResult: (state) => state,
    },
});


